- Part I.
ioslides - Part II.
htmlwidget
ioslideshtmlwidgetioslidesioslideshtml 슬라이드 포맷slidy에 비해서 상대적으로 작업이 쉽고 rendering이 빠름slidy는 customization의 영역이 더 많음)## Subtitling and Incremental Mode | This is my subtitle {.build}
{.build}를 적어주면 incremental mode가 실행됨incremental: truetrivial_code1 <- 0 important_code1 <- 0 important_code2 <- 0 trivial_code2 <- 0
### <b>”와 “### </b>”로 둘러쌓으면 됨As you walk down the fairway of life you must smell the roses, for you only get to play one round. – Ben Hogan
<div class="white">와 </div>로 둘러싸면 하얀색 폰트로 나옴logo에 이미지 파일 경로 지정styles.css 파일을 이용해서 로고 이미지와 테두리 크기 지정smaller: true로 전체적으로 작은 폰트incremental: true는 전체 슬라이드를 incremental mode로 지정transition: slower는 전체 슬라이드에 페이드 효과를 줌htmlwidgetplotly 객체library(ggplot2) library(plotly) fig <- ggplot(mpg, aes(x = displ, y = hwy)) + geom_point(aes(color = class)) + geom_smooth() fig_plotly <- ggplotly(fig) class(fig_plotly)
## [1] "plotly" "htmlwidget"
fig_plotly
dygraphs 객체library(dygraphs)
lungDeaths <- cbind(mdeaths, fdeaths)
fig_dygraph <- dygraph(lungDeaths) %>%
dySeries("mdeaths", label = "Male") %>%
dySeries("fdeaths", label = "Female") %>%
dyOptions(stackedGraph = TRUE) %>%
dyRangeSelector(height = 20)
class(fig_dygraph)
## [1] "dygraphs" "htmlwidget"
fig_dygraph
leaflet() - Interactive maplibrary(leaflet)
fig_leaflet <- leaflet() %>% addTiles() %>%
setView(127.076, 37.631, zoom = 16) %>%
addMarkers(127.076, 37.63148, label="We're here!",
labelOptions = labelOptions(noHide = TRUE, textsize = "15px"))
class(fig_leaflet)
## [1] "leaflet" "htmlwidget"
fig_leaflet
DT (DataTables) 객체library(DT) tbl_DT1 <- datatable(iris) class(tbl_DT1)
## [1] "datatables" "htmlwidget"
tbl_DT1
tbl_DT2 <-
datatable(iris,
caption = '(Caption) Table 1: This is iris dataset.',
rownames = FALSE,
fillContainer = FALSE,
options = list(pageLength = 8),
class = 'cell-border stripe')
caption 위치를 바꿀 수도 있음fillContainer = TRUE이면 크기를 자동 조정options = list(pageLength = 12)로 초기 행의 갯수 지정class = 'cell-border stripe'는 세로줄 추가tbl_DT2